package com.monochromebytes.mononet.stub;

import java.io.IOException;

public interface StubSocketListener {

    /**
     * Will be invoked when a new Stub has been created by the StubSocket, the
     * listener is observing.
     * 
     * @param socket
     *            The socket that has been closed.
     * @param e
     *            The Exception that was thrown or null.
     */
    public void incomingStub(Stub stub);

    /**
     * Will be invoked when a StubSocket, the listener is observing, has been
     * closed.
     * 
     * @param socket
     *            The socket that has been closed.
     * @param e
     *            The Exception that was thrown or null.
     */
    public void socketClosed(StubSocket socket, IOException e);

    /**
     * Will be invoked when a StubSocket, the listener is observing, has been
     * opened.
     * 
     * @param socket
     *            The socket that has been opened.
     */
    public void socketOpened(StubSocket socket);
}
